package com.woniu.hackredis;

import java.io.IOException;
import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;
import java.nio.charset.StandardCharsets;

/**
 * @author:陈涵
 * @Do:模拟redis服务器写一个假程序来获取真正的redis服务
 */
public class MyHackRedis {
    public static void main(String[] args) throws IOException {
        ServerSocket serverSocket=new ServerSocket(6379);
        Socket socket=serverSocket.accept();
        InputStream inputStream = socket.getInputStream();
        byte[] read=new byte[2048];
        inputStream.read(read);
        System.out.println(new String(read, StandardCharsets.UTF_8));
//        socket.close();
//        serverSocket.close();

    }
}
